import Vue from 'vue'
import VueRouter from "vue-router"
import VueResource from "vue-resource"

import Home from "../components/Home.vue"
import TimeEntries from '../components/TimeEntries.vue'
import LogTime from '../components/LogTime.vue'
import Login from '../components/Login'
import Index from '../components/Index'

Vue.use(VueRouter);
Vue.use(VueResource);


const routes = [{
  path: '/',
  component: Login
}, {
  path: '/index',
  component: Index
}, {
  path: '/home',
  component: Home
}, {
  path: '/time-entries',
  component: TimeEntries,
  children: [{
    path: '/time-entries/log-time',
    // 懒加载
    component: LogTime
  }]
}];

export default new VueRouter({routes});
